Network devices, such as routers, are used to send and receive packets in a network. Monitoring internal devices operating in a network device and/or links serving a network device may involve maintaining statistics about packets entering or leaving the network device. For example, statistics may be maintained on the number of packets entering or leaving the network device via a link, such as by using counters to count the number of packets entering or leaving the network device.
Since modern network devices operate at very high speeds, counters may need to be implemented in fast logic to adequately count incoming and/or outgoing packets. Since fast logic can be expensive, fast counters may be implemented in limited sizes (i.e., the number of bits that the counter can accommodate). As a result, fast counters may need to be read at high rates to ensure that a counter is sampled before it rolls (i.e., before the counter reaches its maximum value and writes over that maximum value). Meaningful counter data may be lost when a counter rolls, so maintaining adequate sampling rates for counters operating in a network device may be important to gathering meaningful statistics about the performance of the network device. Sampling fast counters at high rates may place undesirably high loadings on the control logic for the network device and may hinder network device performance.